import { axios } from '@/utils/request'

const api = {
  get_list: '/store/list',
  get_check_list: '/store/get-check-list',
  add_store: '/store/add',
  del: '/store/del',
  set_share_params: '/store/set-share-params',
  get_share_params: '/store/get-share-params',
  saasDefaultParams: "/saas/saas-default-params",
  get_referral_params: '/store/get-referral-params',
  set_referral_params: '/store/set-referral-params',
  get_transfer_profit_params: '/store/get-transfer-profit-params',
  set_transfer_profit_params: '/store/set-transfer-profit-params',
  getStoreInfo: '/store/get-store-info',
  joinAlliance: '/store/join-alliance',
  douyinInfo: '/store/douyin-info',
  get_store_params: '/store/get-store-params',
  set_store_params: '/store/set-store-params',
  get_category_info: '/store/get-category-info',
  get_delivery_info: '/store/get-delivery-info',
  set_delivery_info: '/store/set-delivery-info',
  set_store_cost: '/store/set-store-cost',
  get_store_cost: '/store/get-store-cost',
  pay_fee: '/store/pay-fee',
  get_is_pay: '/store/get-is-pay',
  store_re_order: '/store/store-re-order',
  change_join_union_status: '/store/change-join-union-status',
  setting_app: '/store/setting-app',
  copyrightSetting: '/store/copyright-setting',
  resetPass: '/store/set-password',
  getPass: '/store/set-password',
  storeRate: '/store/store-rate',
  storeGetList: '/store/get-list',
  getVoiceDeviceInfo: '/store/get-voice-device-info',
  setVoiceDeviceInfo: '/store/set-voice-device-info',
  testVoiceDevice: '/store/test-voice-device',
  getAuditList: '/store/get-audit-list',
  storeAudit: '/store/store-audit',
  bindSalesman: '/store/bind-salesman',
  getQrcode: '/store/get-qrcode',
  setStoreReOrder: '/saas/store-re-order',
  getStoreReOrder: '/saas/store-re-order',
  salesmanList: '/store/salesman-list',
  getKefuInfo: '/store/get-kefu-info',
  setKefuInfo: '/store/set-kefu-info',
  timerTaskCopy: '/store/timer-task-copy',
}

export default api

export function getList (parameter) {
  return axios({
    url: api.get_list,
    method: 'get',
    params: parameter
  })
}

export function addStore (parameter) {
  return axios({
    url: api.add_store,
    method: 'post',
    data: parameter
  })
}

export function delStore (parameter) {
  return axios({
    url: api.del,
    method: 'post',
    data: parameter
  })
}

export function getShareParams (parameter) {
  return axios({
    url: api.get_share_params,
    method: 'get',
    params: parameter
  })
}

export function setShareParams (parameter) {
  return axios({
    url: api.set_share_params,
    method: 'post',
    data: parameter
  })
}

export function getReferralParams (parameter) {
  return axios({
    url: api.get_referral_params,
    method: 'get',
    params: parameter
  })
}

export function setReferralParams (parameter) {
  return axios({
    url: api.set_referral_params,
    method: 'post',
    data: parameter
  })
}

export function getTransferProfitParams (parameter) {
  return axios({
    url: api.get_transfer_profit_params,
    method: 'get',
    params: parameter
  })
}

export function setTransferProfitParams (parameter) {
  return axios({
    url: api.set_transfer_profit_params,
    method: 'post',
    data: parameter
  })
}

export function getStoreInfo (parameter) {
  return axios({
    url: api.getStoreInfo,
    method: 'get',
    params: parameter
  })
}

export function joinAlliance (parameter) {
  return axios({
    url: api.joinAlliance,
    method: 'post',
    data: parameter
  })
}

export function getCheckList (parameter) {
  return axios({
    url: api.get_check_list,
    method: 'get',
    params: parameter
  })
}

export function setDouyinInfo (parameter) {
  return axios({
    url: api.douyinInfo,
    method: 'post',
    data: parameter
  })
}

export function getDouyinInfo (parameter) {
  return axios({
    url: api.douyinInfo,
    method: 'get',
    params: parameter
  })
}

export function getStoreParams (parameter) {
  return axios({
    url: api.get_store_params,
    method: 'get',
    params: parameter
  })
}

export function setStoreParams (parameter) {
  return axios({
    url: api.set_store_params,
    method: 'post',
    data: parameter
  })
}

export function getCategoryInfo (parameter) {
  return axios({
    url: api.get_category_info,
    method: 'get',
    params: parameter
  })
}

export function getDeliveryInfo (parameter) {
  return axios({
    url: api.get_delivery_info,
    method: 'get',
    params: parameter
  })
}

export function setDeliveryInfo (parameter) {
  return axios({
    url: api.set_delivery_info,
    method: 'post',
    data: parameter
  })
}

// 设置商铺金额
export function setStoreCost (parameter) {
  return axios({
    url: api.set_store_cost,
    method: 'post',
    data: parameter
  })
}
// 获取
export function getStoreCost (parameter) {
  return axios({
    url: api.get_store_cost,
    method: 'get',
    params: parameter
  })
}
// 缴纳费用
export function payFee (parameter) {
  return axios({
    url: api.pay_fee,
    method: 'get',
    params: parameter
  })
}
// 判断是否支付
export function isPay (parameter) {
  return axios({
    url: api.get_is_pay,
    method: 'get',
    params: parameter
  })
}
// 获取缴费记录
export function storeReOrder (parameter) {
  return axios({
    url: api.store_re_order,
    method: 'get',
    params: parameter
  })
}

// 修改是否加入联盟状态
export function changeJoinUnionStatus (parameter) {
  return axios({
    url: api.change_join_union_status,
    method: 'post',
    data: parameter
  })
}

// 设置app资料
export function settingApp (parameter) {
  return axios({
    url: api.setting_app,
    method: 'post',
    data: parameter
  })
}

// 获取app资料
export function getAppSetting (parameter) {
  return axios({
    url: api.setting_app,
    method: 'get',
    params: parameter
  })
}

// 设置版权资料
export function settingCopyright (parameter) {
  return axios({
    url: api.copyrightSetting,
    method: 'post',
    data: parameter
  })
}

// 获取版权资料
export function getCopyrightSetting (parameter) {
  return axios({
    url: api.copyrightSetting,
    method: 'get',
    params: parameter
  })
}

// 重置商城密码
export function resetPass (parameter) {
  return axios({
    url: api.resetPass,
    method: 'post',
    data: parameter
  })
}

// 获取商城密码
export function getPass (parameter) {
  return axios({
    url: api.resetPass,
    method: 'get',
    params: parameter
  })
}

// 获取销售溢价
export function getStoreRate () {
  return axios({
    url: api.storeRate,
    method: 'get'
  })
}

// 设置销售溢价
export function setStoreRate (data) {
  return axios({
    url: api.storeRate,
    method: 'post',
    data
  })
}

// 获取未创建云仓商户的商城
export function storeGetList () {
  return axios({
    url: api.storeGetList,
    method: 'post'
  })
}

export function getVoiceDeviceInfo () {
  return axios({
    url: api.getVoiceDeviceInfo,
    method: 'get'
  })
}

export function setVoiceDeviceInfo (parameter) {
  return axios({
    url: api.setVoiceDeviceInfo,
    method: 'post',
    data: parameter
  })
}

export function testVoiceDevice (parameter) {
  return axios({
    url: api.testVoiceDevice,
    method: 'post',
    data: parameter
  })
}

/*
  店铺审核列表
*/
export function getAuditList (params) {
  return axios({
    url: api.getAuditList,
    method: 'get',
    params
  })
}

/*
  店铺审核
*/
export function storeAudit (data) {
  return axios({
    url: api.storeAudit,
    method: 'post',
    data
  })
}

/*
  绑定业务员
*/
export function bindSalesman (data) {
  return axios({
    url: api.bindSalesman,
    method: 'post',
    data
  })
}

/*
  获取空聚合码
*/
export function getQrcode (data) {
  return axios({
    url: api.getQrcode,
    method: 'post',
    data
  })
}

/*
  店铺缴费设置
*/
export function setStoreReOrder (data) {
  return axios({
    url: api.setStoreReOrder,
    method: 'post',
    data
  })
}

export function getStoreReOrder () {
  return axios({
    url: api.getStoreReOrder,
    method: 'get'
  })
}

export function saasDefaultParams () {
  return axios({
    url: api.saasDefaultParams,
    method: 'get'
  })
}

export function salesmanList () {
  return axios({
    url: api.salesmanList,
    method: 'post'
  })
}

export function getKefuInfo (parameter) {
  return axios({
    url: api.getKefuInfo,
    method: 'get',
    params: parameter
  })
}

export function setKefuInfo (data) {
  return axios({
    url: api.setKefuInfo,
    method: 'post',
    data
  })
}

export function timerTaskCopy (parameter) {
  return axios({
    url: api.timerTaskCopy,
    method: 'get',
    params: parameter
  })
}

export function setCopyright (data, method = 'get') {
  return axios({
    url: '/store/set-copyright',
    method,
    params: method == 'get' ? data : '',
    data: method == 'get' ? '' : data,
  })
}
